<%@ page import="com.qf.entity.Admin" %><%--
  Created by IntelliJ IDEA.
  User: Ken
  Date: 2022/3/29
  Time: 15:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
  <head>
    <title>学生管理系统</title>
    <script>
      //注销
      function logout(){
        //发送请求给注销的servlet
        location.href="logout";
      }
    </script>
  </head>
  <body>
    <%--<% //获取session中的元素
        Admin admin = (Admin) session.getAttribute("login_user");
        if (admin == null) {
            //说明当前浏览器没有登录，强制跳转到登录页
            response.sendRedirect("login.jsp");
            return;
        }
    %>--%>

   <%-- <c:if test="${empty sessionScope.login_user}">
        <c:redirect url="login.jsp"/>
    </c:if>--%>

    <img style="width: 200px; height: 200px;" src="headershow"/>
    <h1>学生管理系统首页！欢迎${login_user.name}登录</h1>
    <button onclick="logout();">退出登录</button>
    <hr/>
    <div style="margin-top: 20px">

        <c:if test="${fn:contains(login_user.powers, '1') }">
            <button onclick="javascript:location.href='querystudent'">学生列表</button>
        </c:if>
        <br/>
        <br/>
        <c:if test="${fn:contains(login_user.powers, '2') }">
            <button onclick="javascrpit:location.href='addstudent.jsp'">新增学生</button>
        </c:if>
    </div>
  </body>
</html>
